package top.riske.gen3d.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Service;
import top.riske.gen3d.mapper.Hunyuan3DFileMapper;
import top.riske.gen3d.entity.Hunyuan3DFile;
import top.riske.gen3d.service.Hunyuan3DFileService;
import top.riske.gen3d.service.Hunyuan3DJobService;

import java.util.List;

@Service
public class Hunyuan3DFileServiceImpl extends ServiceImpl<Hunyuan3DFileMapper, Hunyuan3DFile> implements Hunyuan3DFileService {


    @Resource
    private Hunyuan3DJobService hunyuan3DJobService;

    @Override
    public List<Hunyuan3DFile> listPreviewModelImage(HttpServletRequest request) {
        List<Hunyuan3DFile> fileList = this.list();
        // 处理路径
        for(Hunyuan3DFile file : fileList){
            hunyuan3DJobService.handlePathToUrl(file, request);
        }
        return fileList;
    }


}
